# -*- coding: utf-8 -*-
import cherrypy
import auth
import index
import db
from anketa import AnketaController
from auth import AuthController
from circle_preview import CirclePreviewController
from circle import CircleController
from contacts import contacter, where
from index import template

class Info:

    @cherrypy.expose
    def index(self):
        return index.text()

    @cherrypy.expose
    def register(self):
        return template(AuthController().get_registration_form())

    @cherrypy.expose
    def login(self):
        return template(AuthController().get_login_form())    

cherrypy.response.headers['Content-Type'] = 'text/html; charset=utf-8' 

root = Info()
root.auth = AuthController()
root.authcontroller = AuthController()
root.login = AuthController().login
root.logout = AuthController().logout
root.anketa = AnketaController()
root.circle_preview = CirclePreviewController()
root.circle = CircleController()
root.circle_preview.edit = CirclePreviewController().form
root.circle.edit = CircleController().form
root.contacts = contacter
root.where = where
cherrypy.quickstart(root,'/','config')

